<div class="row">
    <div class="col-lg-12">
        <h3 class="page-header">Danh sách người dùng</h3>
    </div>
    <!-- /.col-lg-12 -->
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">            
            <div class="panel-heading">
                <div class="row">
                    <div class="col-lg-3">                        
                    </div>
                </div>
            </div>
            <div class="panel-body">
                <div class="table-reponsive">
                    <div id="jqxgrid">

                    </div>
                </div>
            </div>
    </div>
</div>
<script type="text/javascript">
        $(document).ready(function () {
            // prepare the data
            var source =
            {
                datatype: "json",
                datafields:
                [
                    { name: 'id',type:'int'},
                    { name: 'username', type: 'string' },                    
                    { name: 'first_name', type: 'string' },
                    { name: 'last_name', type: 'string' },
                    { name: 'phone', type: 'string' },
                    { name: 'birthday', type: 'string' },
                    { name: 'order', type: 'int' },
                    { name: 'status', type: 'boolean' }
                ],
                url:"<?php echo $this->baseUrl().'/admin/user/service/status=1'?>",
                sortcolumn: 'order_province',
                sortdirection: 'asc'
               
            };
         var dataAdapter = new $.jqx.dataAdapter(source, {
                loadComplete: function () {
                }
            });
            $("#jqxgrid").jqxGrid(
            {
                width: '100%',
                source: dataAdapter,  
                theme: 'bootstrap',
                pageable: true,
                showfilterrow: true,
                filterable: true,
                autoheight: true,
                sortable: true,
                altrows: true,
                enabletooltips: true,
                selectionmode: 'multiplecellsadvanced',
                columnsResize: true,
                rendergridrows: function (params) {
                    return params.data;
                },
                ready: function () {
                    $("#jqxgrid").jqxGrid('hideColumn', 'id');
                },
                columns: [
                  {text:'id',dataField:'id',cellsalgin:'right',width:0},
                  { text: 'Tên đăng nhập',editable: false, dataField: 'username', width: '25%' },
                  { text: 'Họ', editable: false, dataField: 'last_name', width: '20%' },
                  { text: 'Tên', editable: false, dataField: 'first_name', width: '15%' },
                  { text: 'Ngày sinh', editable: false, dataField: 'birthday', width: '15%' },
                  { text: 'Số điện thoại', editable: false, dataField: 'phone', width: '15%' },
                  { text: 'Thứ tự', editable: false, dataField: 'order', width: '10%' }
                  
                ]
            });
           
        });
    </script>